;(function() {

  var getInfo = {

    aid: hlUrlUtil.GetQueryString('id'),
    pid: hlUrlUtil.GetQueryString('pid'),

    init: function() {
      this.getInfo()
      this.getPayPlan()
      loginPrem.loginList()
    },

    getInfo: function() {
      var _self = this,
        temp,
        tempJ;

      $('.js-zj-content,.js-zq-content,.js-yc-content,.js-qt-content').html('')

      hlhttp.get({
        data: {
          "id": _self.aid, //合同ID
          "project_id": _self.pid //项目ID
        },
        url: 'contract',
        success: function(data) {

          var state;

          if (data.depositType === 'YJ') {
            state = hlCodeConvert.depositType(data.depositType) + ' 押' + data.depositPeriod + ' 付' + data.paymentPeriod
          } else {
            state = hlCodeConvert.depositType(data.depositType) + data.deposit + '元 租金' + data.paymentPeriod + '月一付'
          }

          $('.js-audit button').each(function(index, el) {

            if (data.auditState === 'PA' || data.auditState === 'RJ' || data.auditState === 'GC' || data.auditState === 'EX') {

              $('.js-audit button').addClass('hide');

              if ($(el).text() === '返回') {
                $(el).removeClass('hide')
              }
              $('.js-audit').attr('data-flag', 'yes')
            }

          })

          $('.js-name').html(data.operatorName)
          $('.js-contract-name').text(data.contractName ? data.contractName : '--')
          $('.js-mCode').html(data.mCode)
          $('.js-cCode').html(data.cCode)
          $('.js-operatorName').html(data.operatorName)
          $('.js-zlfCompany').html(data.zlfCompany)

          if (data.zlfCompany === '个人租赁') {
            $('.js-change-name').text('租赁人：')
          } else {
            $('.js-change-name').text('公司名称：')
          }

          $('.js-industry_type').text(hlCodeConvert.industryType(data.industryType))

          $('.js-zlfIperson').html(data.zlfLperson)
          $('.js-zlflphone').html(data.zlfLphone)
          $('.js-zlfSperson').html(data.zlfSperson)
          $('.js-zlfSphone').html(data.zlfSphone)
          $('.js-zlfAddress').html(data.zlfAddress)
          $('.js-rentPrice').html(data.rentPrice + '元/m²/天')
          $('.js-acreage').html(data.acreage + 'm²')
          $('.js-paymentTdays').html(data.paymentTdays + '天')
          $('.js-signTime').html(hlDateUtil.formatUTCDate((data.signTime || ''), 'yyyy-MM-dd'))
          $('.js-depositType').html(state)
          $('.js-beginDate').html(hlDateUtil.formatUTCDate(data.beginDate, 'yyyy-MM-dd') + ' 到 ' + hlDateUtil.formatUTCDate(data.endDate, 'yyyy-MM-dd'))
          $('.js-freeDate').html(data.freeDate)

          temp = data.rentIncresePercent != undefined
            ? data.rentIncresePercent.split(',')
            : ''
          tempJ = data.rentIncreasePrice != undefined
            ? data.rentIncreasePrice.split(',')
            : ''

          for (var j = 1; j < temp.length; j++) {
            $('.js-zj-content').append('<div class="row border-t">' +
              '<div class="col-md-4 lin-hei-45 border-r">第' + (j + 1) + '年</div>' + '<div class="col-md-4 lin-hei-45 border-r">' + (temp[j]) + '%</div>' + '<div class="col-md-4 lin-hei-45">' + tempJ[j] + '</div>' + '</div>')
          }

          $('.shop-append,.car-append').html('')
          var dataContarct = {
            buildingName: [],
            businessType: [],
            floorNum: [],
            projectName: '',
            unit: []
          }

          var unit = data.units;
          for (var i = 0; i < unit.length; i++) {
            dataContarct.buildingName.push({type: unit[i].businessType, name: unit[i].buildingName, num: unit[i].floorNum})
            dataContarct.projectName = unit[i].projectName;
            dataContarct.floorNum.push({type: unit[i].businessType, bname: unit[i].buildingName, num: unit[i].floorNum})
            dataContarct.unit.push({num: unit[i].floorNum, name: unit[i].unitName, area: unit[i].unitAcreage})
          }
          Array.prototype.removeRepeat = function() {
            var res = [this[0]];
            for (var i = 1; i < this.length; i++) {
              var repeat = false;
              for (var j = 0; j < res.length; j++) {
                if (this[i].num == res[j].num) {
                  repeat = true;
                }
              }
              if (!repeat) {
                res.push(this[i]);
              }
            }
            return res;
          };
          var buildingName = dataContarct.buildingName.removeRepeat();
          var str = '';
          var str1 = '';

          for (var i = 0; i < buildingName.length; i++) {
            if (buildingName[i].type !== 'ST') {
              str += '<div class="box-contract"><div class="dy"><span class="pname color-666">' + dataContarct.projectName + '</span> <span class="bname color-666" data-value="' + buildingName[i].type + '">' + buildingName[i].name + '</span> <span class="fname color-666">' + buildingName[i].num + '</span>楼： <span class="aname"></span></div></div>'
            } else {
              str1 += '<div class="box-contract"><div class="st"><span class="pname color-666">' + dataContarct.projectName + '</span> <span class="bname color-666" data-value="' + buildingName[i].type + '">' + buildingName[i].name + '</span> <span class="fname color-666">' + buildingName[i].num + '</span>楼： <span class="aname"></span></div></div>'
            }
          }
          $('.shop-append').html(str)
          $('.car-append').html(str1)
          $('.js-project-info').html(dataContarct.projectName)

          var unit = dataContarct.unit,
            comma;
          for (var j = 0; j < unit.length; j++) {
            if (j < unit.length - 1) {
              comma = '、'
            } else {
              comma = ''
            }
            $('.box-contract').each(function(index, el) {
              if ($(el).find('.fname').text() == unit[j].num) {
                $(el).find('.aname').append(' ' + unit[j].name + '<b class="color-999">(' + unit[j].area + 'm²)<b>' + comma)
              }
            });
          }
          if ($('.car-append').children().length == 0) {
            $('.car-append').parent().addClass('hide')
          } else {
            $('.car-append').parent().removeClass('hide')
          }
          if ($('.shop-append').children().length == 0) {
            $('.shop-append').parent().addClass('hide')
          } else {
            $('.shop-append').parent().removeClass('hide')
          }

          var expenses = data.expenses;
          for (var i = 0; i < expenses.length; i++) {
            if (expenses[i].expenseType === 'O') {
              $('.js-yc-content').append('<div class="row border-t">' +
                '<div class="col-md-4 lin-hei-45 border-r">' + expenses[i].expenseName + '</div>' + '<div class="col-md-8 lin-hei-45">' + expenses[i].expense + '</div>' + '</div>')
            }
            if (expenses[i].expenseType === 'P') {
              $('.js-zq-content').append('<div class="row border-t">' +
                '<div class="col-md-4 lin-hei-45 border-r">' + expenses[i].expenseName + '</div>' + '<div class="col-md-4 lin-hei-45 border-r">' + expenses[i].expense + '</div>' + '<div class="col-md-4 lin-hei-45">' + expenses[i].expensePeriods + '月</div>' + '</div>')
            }
            if (expenses[i].expenseType === 'E') {
              $('.js-qt-content').append('<div class="row border-t">' +
                '<div class="col-md-4 lin-hei-45 border-r">' + expenses[i].expenseName + '</div>' + '<div class="col-md-8 lin-hei-45">' + expenses[i].expense + '</div>' + '</div>')
            }
          }

          setTimeout(function() {

            if ($('.js-zj-content').children().length === 0) {
              $('.js-d-cost').addClass('hide')
            }

            if ($('.js-yc-content').children().length === 0) {
              $('.js-o-cost').addClass('hide')
            }

            if ($('.js-qt-content').children().length === 0) {
              $('.js-e-cost').addClass('hide')
            }

            if ($('.js-zq-content').children().length === 0) {
              $('.js-p-cost').addClass('hide')
            }

          }, 100);

          _self.fnAudit()
        }
      })
    },

    //审核
    fnAudit: function() {

      var _self = this;

      $('.js-audit button').each(function(index, el) {

        $(el).unbind().on('click', function(event) {

          if ($(el).text() === '审核通过') {
            if ($('.js-audit').attr('data-flag') === 'yes')
              return;

            hllayer.confirm('是否确认审核通过，通过后合同即生效!', function() {
              hlhttp.put({
                headers: {
                  token: Cookies.get('token'),
                  contract_id: _self.aid
                },
                data: {
                  "id": _self.aid, //合同ID
                  "project_id": _self.pid //项目ID
                },
                url: 'contract/_pass',
                success: function(data) {
                  $(el).addClass('hide').siblings().addClass('hide')
                  $('.js-audit').attr('data-flag', 'yes')
                  $('.js-audit button').addClass('hide')
                  $('.hllayer-page').remove()
                  $('.hllayer-mask').remove()
                }
              })
            })
          }

          if ($(el).text() === '审核拒绝') {
            if ($('.js-audit').attr('data-flag') === 'yes')
              return;
            $('.js-cost-reject,.backdrop').removeClass('hide');
            _self.reject()
          }

          if ($(el).text() === '作废') {
            if ($('.js-audit').attr('data-flag') === 'yes')
              return;
            hllayer.confirm('此操作不可逆转，确认作废合同吗？', function() {
              hlhttp.put({
                headers: {
                  token: Cookies.get('token'),
                  contract_id: _self.aid
                },
                data: {
                  "id": _self.aid, //合同ID
                  "project_id": _self.pid //项目ID
                },
                url: 'contract/_cancel',
                success: function(data) {
                  $(el).addClass('hide').siblings().addClass('hide')
                  $('.js-audit').attr('data-flag', 'yes')
                  $('.js-audit button').addClass('hide')
                  $('.hllayer-view,.hllayer-mask').remove()
                }
              })
            })

          }

          if ($(el).text() === '返回') {
            window.history.go(-1)
          }

          event.preventDefault();
        });
      });

    },

    reject: function() {

      var _self = this;

      $('.js-ok-q').unbind().on('click', function(event) {
        hlhttp.put({
          headers: {
            token: Cookies.get('token'),
            contract_id: _self.aid
          },
          data: {
            "id": _self.aid, //合同ID
            "project_id": _self.pid, //项目ID
            fail_memo: $('.js-memo-q').val() || ''
          },
          url: 'contract/_reject',
          success: function(data) {
            $('.js-audit button').addClass('hide')
            $('.js-audit').attr('data-flag', 'yes')
            $('.js-audit button').addClass('hide')
            $('.js-cost-reject,.backdrop').addClass('hide');

            window.localStorage.setItem('contractState', 'RJ')
          }
        })
        event.preventDefault();
      })

      $('.js-not-q').unbind().on('click', function(event) {
        $('.js-memo-q').val('')
        $('.pop,.backdrop').addClass('hide')
        event.preventDefault();
      })

      $('.js-close-cost').unbind().on('click', function() {
        $('.js-cost-reject').addClass('hide')
        $('.pop,.backdrop').addClass('hide')
      })

    },

    // 付款计划表头数据
    payPlanData: [],

    //获取付款计划
    getPayPlan: function() {
      var contractID = this.aid,
        self = this;
      hlhttp.get({
        url: 'contracts/bill_plans',
        data: {
          contract_id: contractID
        },
        success: function(data) {
          if (data.length) {
            self.showPayData(data)
          }
        }
      })
    },
    // 付款数据处理
    showPayData: function(data) {
      var self = this,
        oArr = [],
        pArr = [],
        rArr = [],
        expenseObj = {};

      $('.js-pay-plan-cr').show()
      $('.js-rent-date-num').text(data.length)
      // 周期性费项
      data.map(function(item) {
        item.expenseList.map(function(_item) {
          if (_item.expenseType === 'P') {
            var flag = true
            pArr.map(function(_item1) {
              if (_item1.name === _item.name) {
                flag = false
              }
            })
            if (flag) {
              pArr.push(_item)
            }
          }
        })
      })
      // 一次性费项
      data[0].expenseList.map(function(_item) {
        if (_item.expenseType === 'O') {
          oArr.push(_item)
        }
      })
      self.payPlanData = []
      self.payPlanData.push('固定租金')
      pArr.map(function(item) {
        self.payPlanData.push(item.name)
      })

      expenseObj = {
        'O': oArr,
        'P': pArr
      }

      self.dom.totalPrice(expenseObj)
      self.dom.payPlanHead(expenseObj)
      self.dom.payPlanBody(data, expenseObj)
    },

    dom: {
      // 付款计划表头
      payPlanHead: function(obj) {
        var titleHtml = '',
          bodyHtml = '',
          pHtml = '',
          oHtml = '',
          natureWidth = 355, // 租约期 + 付款日 + 合计 总宽度
          pWidth = 0,
          oWidth = 0,
          oHeight = 50,
          oPadding = 0, // 租约期项内置padding值
          width = 0;

        // 周期性费项
        if (obj.P.length !== 0) {
          var pIndex = 0;
          obj.P.map(function(item) {
            titleHtml += '<div data-qm="' + item.name + '" class="item-3 title-p ellipsis-1"><span>' + item.name + '</span>(元)</div>'
            pHtml += '<div class="item-3 type-p p-' + pIndex + '">' + '<span class="js-title-p-item">' + '<input type="text" class="form-control box-i-shadow-acc text-center" disabled>' + '</span>' + '</div>'

            pIndex++
          })
          $('.js-title-rent-item').after(titleHtml)
          $('.js-body-rent-item').after(pHtml)
        }
        // 一次性费项
        if (obj.O.length !== 0) {
          $('.js-title-one-expense').show()
          $('.js-body-one-expense').show()

          obj.O.map(function(item) {
            oHtml += '<li class="one-expenses-item clearfix font-12" data-expenselateFee="' + item.expenselateFee + '">' + '<span data-qm="' + item.name + '"><i>' + item.name + '</i></span>' + '<span class="one-expenses-item-wrapper">' + '<input type="text" value="' + item.expense + '"class="form-control text-center js-one-expenses-ipt" disabled>' + '</span>' + '</li>'
          })
          $('.js-body-one-expense ul').html(oHtml)
        }

        // 计算宽度高度
        if (obj.P.length !== 0) {
          pWidth = 100 * (obj.P.length + 1)
        }
        if (obj.O.length !== 0) {
          oWidth = 200
          oHeight = 50 * obj.O.length
        }
        if (obj.O.length === 1)
          oPadding = 10
        if (obj.O.length > 1)
          oPadding = 10 + (obj.O.length - 1) * 25 // 一次性费项每多一项 内padding加25px

        width = natureWidth + pWidth + oWidth
        if (width > 955) {
          $('.pay-plan-table .title').css({
            width: width + 'px'
          })
          $('.pay-plan-table .body').css({
            width: width + 'px'
          })
        }

        // 除租约期外其余项垂直居中
        $('.first-expense-row div').css({
          height: oHeight + 'px',
          lineHeight: oHeight + 'px'
        })
        // 租约期项垂直居中
        $('.first-expense-row .item-1').css({
          height: oHeight + 'px',
          lineHeight: '15px',
          padding: oPadding + 'px 0'
        })
      },
      // 付款计划表内容
      payPlanBody: function(data, obj) {
        var html = '',
          index = 0,
          isOexpense = false;
        // 是否显示一次性费项列表
        data[0].expenseList.map(function(_item) {
          if (_item.expenseType === 'O') {
            isOexpense = true
          }
        })

        data.map(function(item) {
          var totalPrice = 0

          if (index == 0) {
            var time = hlDateUtil.formatUTCDate(item.beginDate, 'yyyy-MM-dd') + '<br/>' + hlDateUtil.formatUTCDate(item.endDate, 'yyyy-MM-dd')
            $('.first-expense-row .item-1').html(time)
            $('.first-expense-row .item-2').text(hlDateUtil.formatUTCDate(item.paymentDeadLineDate, 'yyyy-MM-dd'))
          }

          if (index >= 1) {
            html = '<div class="other-expense-row expense-row">' +
              '<div class="item-1 clearfix"><i>' + hlDateUtil.formatUTCDate(item.beginDate, 'yyyy-MM-dd') + '<br/>' + hlDateUtil.formatUTCDate(item.endDate, 'yyyy-MM-dd') + '</i></div>' + '<div class="item-2">' + hlDateUtil.formatUTCDate(item.paymentDeadLineDate, 'yyyy-MM-dd') + '</div>' + '<div class="item-3 type-r js-body-other-rent-item">' + '<input type="text" class="form-control box-i-shadow-acc text-center js-rentPrice" disabled>' + '</div>' + '<div class="item-4 type-o ' + (isOexpense
                ? 'show'
                : 'hide') + '">' + '<span>--</span>' + '</div>' + '<div class="item-5 js-expense-price"></div>' + '</div>'
          }

          $('.js-other-expense-cr').append(html)

          var pHtml = ''
          // 生成周期性费用表
          if (obj.P.length !== 0) {
            var pIndex = 0
            obj.P.map(function(item) {
              pHtml += '<div class="item-3 type-p p-' + pIndex + '">' + '<input type="text" class="form-control box-i-shadow-acc text-center" disabled>' + '</div>'

              pIndex++
            })
          }
          $($('.js-body-other-rent-item')[index - 1]).after(pHtml)
          // 租金、周期性费用、费用滞纳金展示
          var expenseIndex = 0
          getInfo.payPlanData.map(function(_item1) {
            var flag = false
            item.expenseList.map(function(_item2) {
              if (_item1 === _item2.name) {
                var _node = $($('.expense-row')[index]).find('.item-3')
                $(_node[expenseIndex]).find('input').val(_item2.expense)
                $(_node[expenseIndex]).attr('data-expenselateFee', _item2.expenseLateFee)
                flag = true
              }
            })
            if (flag == false) {
              var _node = $($('.expense-row')[index]).find('.item-3')
              $(_node[expenseIndex]).find('input').val('--')
            }
            expenseIndex++;
          })
          // 合计价钱
          item.expenseList.map(function(_item1) {
            totalPrice += Number(_item1.expense)
          })
          $($('.js-expense-price')[index]).text(totalPrice.toFixed(2))

          index++;
        })
        // 价钱合计
        // 租金
        var totalRent = 0
        $('.js-rentPrice').each(function(index, _item) {
          var _val = $(this).val().trim()
          if (_val != '--') {
            totalRent += Number(_val)
          }
        })
        $('.js-body-rent-price-item').text(totalRent.toFixed(2))
        // 一次性费用
        if (obj.O.length !== 0) {
          var oTotalPrice = 0
          $('.one-expenses-item').each(function(index, _item) {
            var _val = $(this).find('input').val().trim()
            oTotalPrice += Number(_val)
          })
          $('.js-one-total-price').text(oTotalPrice.toFixed(2))
        }
        // 周期性费用
        if (obj.P.length !== 0) {
          var pIndex = 0;
          obj.P.map(function(_index1, _item1) {
            var selector = '.p-' + pIndex
            var pTotalPrice = 'pTotalPrice-' + pIndex
            pTotalPrice = 0
            var price = '.pTotal-' + pIndex

            $(selector).each(function(_index2, _item2) {
              var _val = $(this).find('input').val().trim()
              if (_val != '--') {
                pTotalPrice += Number(_val)
              }
            })
            $(price).text(pTotalPrice.toFixed(2))
            pIndex++
          })
        }
        // 总价钱
        var allTotalPrice = 0
        $('.js-expense-price').each(function() {
          allTotalPrice += Number($(this).text())
        })
        $('.js-price-contract').text(allTotalPrice.toFixed(2))

        // 根据表头内容重设宽度 当一次性费用和周期性费用项加起来不足6时均分600px空间 固定租金始终算一个周期性费项
        // 一次性费用占两份空间

        // 有一次性费用  周期性一个
        if (obj.O.length !== 0 && obj.P.length === 0) {
          $('.pay-plan-table .item-4').css({width: '400px'})
          $('.pay-plan-table .item-3').css({width: '200px'})
        }
        // 有一次性费用  周期性二个
        if (obj.O.length !== 0 && obj.P.length === 1) {
          $('.pay-plan-table .item-4').css({width: '300px'})
          $('.pay-plan-table .item-3').css({width: '150px'})
        }
        // 有一次性费用  周期性三个
        if (obj.O.length !== 0 && obj.P.length === 2) {
          $('.pay-plan-table .item-4').css({width: '240px'})
          $('.pay-plan-table .item-3').css({width: '120px'})
        }
        // 无一次性费用  周期性一个
        if (obj.O.length === 0 && obj.P.length === 0) {
          $('.pay-plan-table .item-3').css({width: '600px'})
        }
        // 无一次性费用  周期性二个
        if (obj.O.length === 0 && obj.P.length === 1) {
          $('.pay-plan-table .item-3').css({width: '300px'})
        }
        // 无一次性费用  周期性三个
        if (obj.O.length === 0 && obj.P.length === 2) {
          $('.pay-plan-table .item-3').css({width: '200px'})
        }
        // 无一次性费用  周期性四个
        if (obj.O.length === 0 && obj.P.length === 3) {
          $('.pay-plan-table .item-3').css({width: '150px'})
        }
        // 无一次性费用  周期性五个
        if (obj.O.length === 0 && obj.P.length === 4) {
          $('.pay-plan-table .item-3').css({width: '120px'})
        }
      },
      // 合计表
      totalPrice: function(obj) {
        var titleHtml = '',
          bodyHtml = '',
          otitleHtml = '',
          obodyHtml = '',
          totalPrice = 0,
          natureWidth = 120, // 费用项宽度
          oWidth = 0,
          pWidth = 0,
          width = 0; //  合计表总宽度

        if (obj.P.length !== 0) {
          var pIndex = 0;
          obj.P.map(function(item) {
            titleHtml += '<div data-qm="' + item.name + '" class="item-2 titleTotal-p">' + item.name + '</div>'
            bodyHtml += '<div class="item-2 bodyTotal-p pTotal-' + pIndex + '">0.00</div>'
            pIndex++
          })
          $('.js-title-rent-price-item').after(titleHtml)
          $('.js-body-rent-price-item').after(bodyHtml)
        }
        if (obj.O.length !== 0) {
          otitleHtml = '<div class="item-2 titleTotal-o">一次性费用</div>'
          obodyHtml = '<div class="item-2 bodyTotal-o js-one-total-price">0.00</div>'
          $('.js-totalPrice-tb .title').append(otitleHtml)
          $('.js-totalPrice-tb .body').append(obodyHtml)
        }

        if (obj.O.length !== 0) {
          width = (obj.P.length + 2) * 119 + natureWidth // 固定租金 + 一次性费项 + 固定性费项
        }
        if (obj.O.length === 0) {
          width = (obj.P.length + 1) * 119 + natureWidth // 固定租金 + 固定性费项
        }
        if (width > 955) {
          $('.js-totalPrice-tb .title').css({
            width: width + 'px'
          })
          $('.js-totalPrice-tb .body').css({
            width: width + 'px'
          })
        } else {
          $('.js-totalPrice-tb .title').css({width: '955px'})
          $('.js-totalPrice-tb .body').css({width: '955px'})
        }

        // 根据表头内容重设宽度 当一次性费用和周期性费用项加起来不足7时均分830px空间 固定租金始终算一个周期性费项
        // 有一次性费用  周期性一个    无一次性费用  周期性二个
        if ((obj.P.length === 0 && obj.O.length !== 0) || (obj.P.length === 1 && obj.O.length === 0)) {
          $('.js-totalPrice-tb .item-2').css({width: '415px'})
        }
        // 有一次性费用  周期性二个    无一次性费用  周期性三个
        if ((obj.P.length === 1 && obj.O.length !== 0) || (obj.P.length === 2 && obj.O.length === 0)) {
          $('.js-totalPrice-tb .item-2').css({width: '276px'})
        }
        // 有一次性费用  周期性三个    无一次性费用  周期性四个
        if ((obj.P.length === 2 && obj.O.length !== 0) || (obj.P.length === 3 && obj.O.length === 0)) {
          $('.js-totalPrice-tb .item-2').css({width: '207px'})
        }
        // 有一次性费用  周期性四个    无一次性费用  周期性五个
        if ((obj.P.length === 3 && obj.O.length !== 0) || (obj.P.length === 4 && obj.O.length === 0)) {
          $('.js-totalPrice-tb .item-2').css({width: '166px'})
        }
        // 有一次性费用  周期性五个    无一次性费用  周期性六个
        if ((obj.P.length === 4 && obj.O.length !== 0) || (obj.P.length === 5 && obj.O.length === 0)) {
          $('.js-totalPrice-tb .item-2').css({width: '138px'})
        }
        // 有一次性费用  周期性六个    无一次性费用  周期性七个
        if ((obj.P.length === 5 && obj.O.length !== 0) || (obj.P.length === 6 && obj.O.length === 0)) {
          $('.js-totalPrice-tb .item-2').css({width: '119px'})
        }
        // 无一次性费用  周期性一个
        if (obj.P.length === 0 && obj.O.length === 0) {
          $('.js-totalPrice-tb .item-2').css({width: '830px'})
        }
      }
    }

  }

  getInfo.init()
}())
